<h1 class="page-title"><?php echo $this->translate('checkout') ?></h1>
<div class="account-login">
    <form id="submit" action="" method="post">
	<div class="col-1 new-users">
		<div class="content">
			<h2><?php echo $this->translate('order') ?></h2>
            
			<table style="width: 100%;">
                <tbody>
                    <?php $i = 0; ?>
                    <?php foreach($this->items as $item): ?>
                    <?php $i++; ?>
                    <input type="hidden" name="items[<?php echo $item['id']; ?>]['id']" value="<?php echo $item['id']; ?>" />
                    <input type="hidden" name="items[<?php echo $item['id']; ?>]['price]" value="<?php echo $item['price']; ?>" />
                    <input type="hidden" name="items[<?php echo $item['id']; ?>]['quantity']" value="<?php echo $item['qty']; ?>" />
                    <input type="hidden" name="items[<?php echo $item['id']; ?>]['total']" value="<?php echo $item['subtotal']; ?>" />
                    <tr>
                        <td style="width: 5%;">
                            <?php echo $i; ?>.
                        </td>
                        <td style="width: 45%;">
                            <a href="<?php echo $this->url(array('name' => $this->ConvertStringToURL($item['name']), 'id' => $item['id']), 'product_detail', true); ?>">
                                <?php echo $item['name']; ?>
                            </a>
                        </td>
                        <td style="width: 10%; text-align: center;">
                            <?php echo number_format($item['qty'], 0, null, "."); ?>
                        </td>
                        <td style="width: 20%; text-align: right;">
                            x <?php echo number_format($item['price'], 0, null, "."); ?>đ
                        </td>
                        <td style="width: 20%; text-align: right;">
                            = <?php echo number_format($item['subtotal'], 0, null, "."); ?>đ
                        </td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="5">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="text-align: right; font-size: 14px; font-weight: bold;" colspan="4">
                            <?php echo $this->translate('total'); ?>
                        </td>
                        
                        <td style="text-align: right; font-weight: bold;">
                            <?php echo number_format($this->subtotal, 0, null, "."); ?>đ
                        </td>
                    </tr>
                </tfoot>
            </table>
		</div>
		<div class="clear"></div>
	</div>
	<div class="col-2 registered-users">
		<div class="content">
			<h2><?php echo $this->translate('customer info') ?></h2>
			<ul class="form-list">
                <li>
					<label class="required" for="email"><?php echo $this->translate('name'); ?><em>*</em></label>
					<div class="input-box">
						<input type="text" title="<?php echo $this->translate('name'); ?>" class="input-text required-entry validate-email" name="customer[name]" value="" />
					</div>
                    <?php if(isset($this->error['name'])): ?>
                    <label class="required" for="email">
                        <em><?php echo $this->error['name']; ?></em>
                    </label>
                    <?php endif; ?>
					<div class="clear"></div>
				</li>
				<li>
					<label class="required" for="email"><?php echo $this->translate('email'); ?><em>*</em></label>
					<div class="input-box">
						<input type="text" title="<?php echo $this->translate('email'); ?>" class="input-text required-entry validate-email" name="customer[email]" value="" />
					</div>
                    <?php if(isset($this->error['email'])): ?>
                    <label class="required" for="email">
                        <em><?php echo $this->error['email']; ?></em>
                    </label>
                    <?php endif; ?>
					<div class="clear"></div>
				</li>
				<li>
					<label class="required" for="email"><?php echo $this->translate('phone number'); ?><em>*</em></label>
					<div class="input-box">
						<input type="text" title="<?php echo $this->translate('phone number'); ?>" class="input-text required-entry validate-email" name="customer[phone_number]" value="" />
					</div>
                    <?php if(isset($this->error['phone_number'])): ?>
                    <label class="required" for="phone_number">
                        <em><?php echo $this->error['phone_number']; ?></em>
                    </label>
                    <?php endif; ?>
					<div class="clear"></div>
				</li>
                <li>
					<label class="required" for="email"><?php echo $this->translate('address'); ?></label>
					<div class="input-box">
						<input type="text" title="<?php echo $this->translate('address'); ?>" class="input-text required-entry validate-email" name="customer[address]" value="" />
					</div>
					<div class="clear"></div>
				</li>
			</ul>
			<p class="required">* <?php echo $this->translate('required'); ?></p>
		</div>
		<div class="buttons-set">
			<a onclick="return submit()" class="colors-btn"  title="<?php echo $this->translate('submit'); ?>"><span><span><?php echo $this->translate('submit'); ?></span></span></a>
			<div class="clear"></div>
		</div>
	</div>
	<div class="clear"></div>
    </form>
</div>
<script>
function submit(){
    $("form#submit").submit();
}
</script>